package exce1.exce01;

import java.util.Scanner;

//评委打分
public class Demo12 {
    public static void main(String[] args) {
        int[] arr=new int[6];
        Scanner sc=new Scanner(System.in);

        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第"+(i+1)+"位评委分数：");
            int num=sc.nextInt();
            if (num>100||num<0){
                System.out.println("输入有误，请核对后输入：");
                i--;
            }else{
                arr[i]=num;
            }
        }
        int max=arr[0];
        int min=arr[0];
        int count=arr[0];
        for (int i = 1; i < arr.length; i++) {
            max=max>arr[i]?max:arr[i];
            min=min<arr[i]?min:arr[i];
            count+=arr[i];
        }
        System.out.println((count-max-min)/(arr.length-2));
    }
}
